cc.Class({
    extends: cc.Component,

    properties: {
        icon: cc.Sprite,
        title: cc.Label,
        own: cc.Label,
        desc: cc.Label
    },

    onLoad () {
        this.detail = this.node.find('detail');
        this.node.on('touchstart', event => {
            this.node.x = 1000;
            event.stopPropagation();
        }, this);
    },

    init(data) {
        this.title.string = data.name;
        this.icon.loadImage(CONFIG.baseUrl + data.awardsImage);
        this.desc.string = data.description;
    },

    setPos(pos) {
        this.detail.x = pos.x - this.node.width / 2;
        this.detail.y = pos.y - this.node.height / 2 + this.detail.height / 2;
        this.node.x = 0;
    }
});
